package com.rest.core.exception;

import java.util.HashMap;
import java.util.Map;

import javax.ws.rs.core.Response;

/**
 * base异常
 * 
 * @Description: base异常，继承RuntimeException
 * @Package com.rest.core.exception.BaseException
 * @author Smile- 2016年4月12日 下午10:29:17
 */
public class BaseException extends RuntimeException {

	/** */
	private static final long serialVersionUID = -7673555328987334401L;

	Map<String, Object> map = new HashMap<String, Object>();
	Response response;

	public BaseException() {
		this("出错啦，赶快联系程序猿！！！");
	}

	public BaseException(String message) {
		this(message, 110);
	}

	public BaseException(String message, Integer code) {
		map.put("message", message);
		map.put("code", code);
		response = Response.status(200).entity(map).type("application/json")
				.build();
	}

	public Response getResponse() {
		return response;
	}

	public void setResponse(Response response) {
		this.response = response;
	}

}
